package a_math;

import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package a_math
 * @date 2024/4/6 14:44
 */
public class test06 {
    public static void main(String[] args) {
        test();
    }

    private static void test() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年：");
        int y = sc.nextInt();
        System.out.println("请输入月份：");
        int m = sc.nextInt();
        System.out.println("请输入日期：");
        int d = sc.nextInt();
        Calendar cal = Calendar.getInstance();
        cal.set(y, m - 1, d);
        Date date = cal.getTime();
        System.out.println(date);;

        if(cal.get(Calendar.YEAR)/4==0||cal.get(Calendar.YEAR)/100!=0)
        {
            System.out.println("是闰年");
        }
        else
        {
            System.out.println("不是闰年");
        }
    }
}
